package clientdcsinstance.client.impl;

import clientdcsinstance.client.ClientRemoteDomaineManagerOperations;
import clientdcsinstance.server.accessers.DataWriter;
import clientdcsinstance.server.accessers.impl.DataWriterImpl;
import clientdcsinstance.server.interfaces.Publisher;
import clientdcsinstance.server.interfaces.Suscriber;
import clientdcsinstance.server.interfaces.impl.PublisherImpl;
import clientdcsinstance.server.operations.Operation;

public class ClientRemoteImpl implements ClientRemoteDomaineManagerOperations{

	private PublisherImpl publisher;
	private DataWriterImpl dataw;
	
	@Override
	public void createPublisher(Suscriber suscriber) {
		publisher = new PublisherImpl(suscriber);
	}

	@Override
	public DataWriter buildDataWriter(Publisher publisher) {
		dataw = new DataWriterImpl(this.publisher);
		return null;
	}
	/**
	 * 
	 * @param topicName : nom du topic executant l'opération
	 * @param operation
	 */
	public void writeOperation(String topicName, Operation operation){
		dataw.write(topicName, operation);
	}
}
